import { ajax } from "../utils";


//清楚缓存
export const clearCache=(data={},loading=true)=>{
    return ajax('cache',data,'post',loading);
}

//获取菜单
export const getMenu=(pid)=>{
    return ajax('getmenu',{pid});
}

//获取树形结构
export const getTree=(url,pid,id=0)=>{
    return ajax(url,{pid,id});
}

//获取ruletree
export const getRuleTree=(url,id=0,loading=false)=>{
    return ajax(url,{id},"get",loading);
}

//通用列表获取
export const getlist=(url,data={},loading=true)=>{
    return ajax(url,data,'get',loading);
}

//通用查询
export const find=(url,data={},loading=true)=>{
    return ajax(url,data,'get',loading);
}

//通用添加.修改.删除
export const crud=(url,data={},loading=true)=>{
    return ajax(url,data,'post',loading);
}